< if test=”startDate!=null and startDate!=’’” > and CREATEDATE >=#{startDate} < /if>
< if test=”endDate!=null and endDate!=’’” > and CREATEDATE <=#{endDate}< /if>
日期字段存入数据库都是字符串,不是 date 型,xml 中 >,< 不能被正确解析,所以需要 XML 转义字符。
< if test=”startDate!=null and startDate!=’’” > and CREATEDATE >=#{startDate} < /if>
< if test=”endDate!=null and endDate!=’’” > and CREATEDATE <=#{endDate}< /if>
日期字段存入数据库都是字符串,不是 date 型,xml 中 >,< 不能被正确解析,所以需要 XML 转义字符。